<%@page import="com.shsh.safemanage.model.Role"%>
<%@page import="com.shsh.safemanage.action.UserAction"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.action.ActionCreator"%>
<%@page import="com.shsh.safemanage.action.WriteProblemAction"%>
<%@page import="com.shsh.safemanage.model.JobPost"%>
<%@page import="com.shsh.safemanage.dao.TitlePostManageGroupDao"%>
<%@page import="com.shsh.safemanage.dao.UserDao"%>
<%@page import="com.shsh.safemanage.dao.DepartmentDao"%>
<%@page import="com.shsh.safemanage.dao.ProblemDao"%>
<%@page import="com.shsh.safemanage.model.Problem"%>
<%@page import="com.shsh.safemanage.model.Equipment"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.EquipmentDao"%>
<%@page import="com.shsh.safemanage.model.User"%>

<%
{
User theUser = (User) session.getAttribute(Constants.SESSION_USER);
DepartmentDao theDepartDao = DaoCreator.createDepartmentDao();
TitlePostManageGroupDao theTitlePostManageGroupDao = DaoCreator.createTitlePostManageGroupDao();
WriteProblemAction theWriteProblemAction = ActionCreator.createWriteProblemAction();
UserAction theUserAction1 = ActionCreator.createUserAction();

JobPost thePost1 = theTitlePostManageGroupDao.getJobPostByID(theUser.getJobPost1ID());
JobPost thePost2 = theTitlePostManageGroupDao.getJobPostByID(theUser.getJobPost2ID());
JobPost thePost3 = theTitlePostManageGroupDao.getJobPostByID(theUser.getJobPost3ID());
Role theUserRole = theUserAction1.getUserRole(request);

int theIntRole = theWriteProblemAction.calRole(thePost1, thePost2, thePost3, theUserRole);
%>
<span style="margin-left: 30px" class="span1">通知人：</span>
<%
if ((theIntRole & Constants.ROLE_TYPE_KEYUAN) > 0) {
%>
<%
List<User> kezhangs = theDepartDao.getUserIDsByDepartment2IDandRoleType(theUser.getDepartment2ID(), Constants.ROLE_TYPE_KEZHANG | Constants.ROLE_TYPE_FUKEZHANG);
if (kezhangs.size() > 0) {
	User kezhang = kezhangs.get(0);
	if (kezhang != null) {
%>
<%=kezhang.getName()%>
<%
	}
}
}
%>
<%
if ((theIntRole & (Constants.ROLE_TYPE_CHUZHANG | Constants.ROLE_TYPE_FUCHUZHANG)) > 0) {
%>
<br />
<span style="margin-left: 30px">选择本处室科室：</span>
<%@include file="depart_select/check_depart2_users_section.jsp"%>
<%
}
%>
<%
if ((theIntRole & (Constants.ROLE_TYPE_KEZHANG | Constants.ROLE_TYPE_FUKEZHANG)) > 0) {
%>
<br />
<span style="margin-left: 30px">选择科室成员处理：</span>
<%@include file="depart_select/check_users_of_depart2_section.jsp"%>
<%
}
%>
<%
}
%>
